var $ = require('jquery');
var base = require("../base.js");
require("jquery.cookie");


module.exports = {

	render: function(data) {
		if (data) {
			var fcount = '<tr><td>{}</td>	<td>{}</td>	<td>{}</td>	<td>{}</td></tr>';
			$("#count").append(base.format(fcount, [data.count.total, data.count.done, data.count.remain, data.count.error]));

			var fh = '<tr><td>{}</td><td>{}</td></tr>';
			var str = '';
			data.his.forEach(function(item, index) {
				str += base.format(fh, [item.createtime, item.score]);
			})
			$("#his").append(str);
		}
	}

}